package com.self.campussecondhandmarket.enums;

/**
 * Author: Vincent
 * <p> DateTime: 2024/4/18 21:27
 * <p> Description: 送货方式枚举
 * <p>
 **/
public enum PickEnum {
	DELIVERY("送货上门", 0),
	PICKUP("自提", 1);
	String desc;
	Integer pick;
	
	PickEnum(String desc, Integer pick) {
		this.desc = desc;
		this.pick = pick;
	}
	
	public static String getDesc(Integer pick) {
		switch (pick) {
			case 0:
				return DELIVERY.desc;
			case 1:
				return PICKUP.desc;
			default:
				return null;
		}
	}
	
	public static Integer getPick(String pick) {
		switch (pick) {
			case "送货上门":
				return DELIVERY.pick;
			case "自提":
				return PICKUP.pick;
			default:
				return null;
		}
	}
	
}
